package day05;
import java.util.Scanner;
public class AdditionLX {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        /*int scane =0;
        for (int i=1;i<=10;i++){
            int a= (int)(Math.random()*100);
            int b= (int)(Math.random()*100);
            int c=a+b;
            System.out.println("("+i+")"+a+"+"+b+"=?");
            System.out.println("算吧！");
            int sum=scan.nextInt();
            if (sum==c){
                System.out.println("恭喜你答对了");
                scane+=10;
            }else{
                System.out.println("恭喜你答错了");
            }
        }
        System.out.println("最终得分为"+scane);*/




        int scant=0;
        for (int i=1;i<=10;i++){
            int a = (int)(Math.random()*100);
            int b =(int)(Math.random()*100);
            int c=a+b;
            System.out.println("("+i+")"+a+"+"+b+"=?");
            System.out.println("算吧");
            int num = scan.nextInt();
            if(num==c){
                System.out.println("猜对了");
                scant+=10;
        }else{
                System.out.println("猜错了");
            }




        }
        System.out.println("总分为"+scant);
    }
}
